package com.sst.common.Test;

import com.sst.common.VO.ConfigGenerator;
import com.sst.common.enums.ConfigIdType;
import com.sst.common.enums.IdType;
import com.sst.common.utils.AutoGenerator;

/**
 * 根据表自动生成实体类，三层架构
 */
public class AutoGeneratorHelper {
    /**
     *
     * 测试 run 执行
     *
     * <p>
     * 配置方法查看 {@link ConfigGenerator}
     * </p>
     *
     */
    public static void main( String[] args ) {
        ConfigGenerator cg = new ConfigGenerator();
        String packageFisrt = "com.sst.sys.";
        cg.setEntityPackage(packageFisrt + "entity");
        cg.setMapperPackage(packageFisrt + "mapper");
        cg.setServicePackage(packageFisrt + "service");
        cg.setServiceImplPackage(packageFisrt + "service.impl");
        cg.setControllerPackage(packageFisrt + "controller");
//		cg.setSuperServiceImpl("com.baomidou.framework.service.impl.SuperServiceImpl");
        cg.setConfigIdType(ConfigIdType.AUTO);
        cg.setIdType(IdType.ID_WORKER);
        cg.setColumnHump(true);
        cg.setSaveDir("J://SST//SSTProject//sst-admin//test");
        cg.setDbDriverName("com.mysql.jdbc.Driver");
        cg.setDbUser("root");
        cg.setDbPassword("root");
        cg.setDbUrl("jdbc:mysql://localhost/sst?useUnicode=true&characterEncoding=utf-8&useSSL=false");
        cg.setDbPrefix(false);
        cg.setColumnHump(false);
//		cg.setTableNames(new String[]{"po_order_main","po_order_detail","po_order_close","po_order_group","po_order_main_log","po_order_note_log"});
        cg.setTableNames(new String[]{"hero"});
        cg.setFileOverride(true);
        AutoGenerator.run(cg);
    }
}
